package io.gitee.chearnee.fw.autoconfigure.httplog;

import io.gitee.chearnee.fw.log.request.interceptor.HttpLogFilter;
import io.gitee.chearnee.fw.log.request.property.RequestLogProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

//@AutoConfiguration
@ConditionalOnProperty(prefix = "fw.web.request.log", name = "enable", havingValue = "true")
@EnableConfigurationProperties(RequestLogProperties.class)
public class HttpLogAutoConfiguration {

    @Bean
    public HttpLogFilter httpLogFilter(RequestLogProperties logProperties) {
        return new HttpLogFilter(logProperties);
    }
}
